Skip to content

feat: native editor bridge, workspace file watcher, and floating chat window for desktop#1768

Merged
lalalune merged 3 commits intodevelopfrom
copilot/build-floating-ide-app
Apr 10, 2026
Merged

feat: native editor bridge, workspace file watcher, and floating chat window for desktop#1768
lalalune merged 3 commits intodevelopfrom
copilot/build-floating-ide-app

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 9, 2026

Foundational plumbing for the Milady floating IDE experience: detect and launch native editors (VS Code, Cursor, Windsurf, etc.), watch workspace files for changes, and present an always-on-top floating chat window when the user switches to a native editor.

New native modules

  • native/editor-bridge.ts — Detects installed editors (VS Code, Cursor, Windsurf, Antigravity, Zed, Sublime) via which/where + per-platform candidate paths. openInEditor(editorId, workspacePath) launches detached via Bun.spawn and records an EditorSession singleton.

  • native/file-watcher.tsfs.watch (recursive) wrapper with 50 ms per-path debounce. Emits typed FileChangeEvent objects; ignores node_modules, .git, dist, etc. Multiple named watches can run simultaneously.

  • floating-chat-window.ts — Singleton FloatingChatWindowManager that creates a second always-on-top BrowserWindow (correct Electrobun API: frame constructor object + setAlwaysOnTop(true) post-creation). Persists last bounds across open/close cycles. Loaded with ?shell=floating-chat so the renderer can mount the compact chat UI variant. configure(rendererUrl, preload) is called from index.ts after the renderer URL resolves.

RPC surface (rpc-schema.ts + rpc-handlers.ts)

New typed request/response pairs:

editorBridgeListEditors / editorBridgeOpenInEditor / editorBridgeGetSession / editorBridgeClearSession
fileWatcherStart / fileWatcherStop / fileWatcherStopAll / fileWatcherList / fileWatcherGetStatus
floatingChatOpen / floatingChatShow / floatingChatHide / floatingChatClose / floatingChatSetContext / floatingChatGetStatus

Push channels: editorBridge:sessionChanged, fileWatcher:fileChanged.

index.ts wiring

  • Calls getFloatingChatManager().configure(url, preload) after the renderer URL promise resolves at startup.
  • Adds a "Floating Chat" entry to the system tray menu.

Tests

Unit tests for both new native modules covering detection, install status, session lifecycle (Bun.spawn mocked), watch CRUD, debounced event emission, and status reporting.

Not included

The apps/ide-app/ React + Monaco scaffold and elizaos.plugin.json manifest (kind: "app") are out of scope for this PR.

Original prompt

Milady Floating IDE App + Native Editor Bridge

Goal:
Build a modern IDE app for the Milady desktop (Electron/Electrobun) platform that features:

  1. An embedded code editor (Web-based, Monaco or VS Code Web) fully integrated with Milady's coding agent orchestrator.
  2. The ability to instantly open the project/workspace in a native editor (VS Code, Cursor, Windsurf, Antigravity, etc).
  3. When in native editor mode, Milady minimizes, and an always-on-top floating chat widget (Electron window) is presented.
  4. The floating chat widget allows continuous conversation (and real-time feedback) with:
    • the main agent,
    • or the specific coding agent/task for the session
  5. Bi-directional file system sync keeps agent, IDE, and native editors in lockstep.
  6. System tray integration for restoring the main window and the floating widget.
  7. Launch/restore commands and global hotkeys for switching between IDE app and chat.

System Architecture

  • Desktop app: Electrobun (Electron) native shell
  • Embedded IDE: Monaco/VSCode web, file explorer, git view, code panel
  • Native editor bridge: Electron main process launches/monitors VS Code, Cursor, etc via protocol handlers or shell commands
  • Floating chat widget: Second always-on-top Electron BrowserWindow, adjustable, docked or free-floating, chat UI
  • IPC and WebSocket: Sync changes between chat widget, agent, IDE, native editor
  • File watcher (chokidar): Detect edits in workspace from either agent, user (IDE), or native editor
  • Tray menu and global shortcuts: For quick access

Key Features

Embedded IDE App

  • Monaco/VSCode-powered code editor
  • Tree/file explorer, diff viewer, terminal, git status, active coding agent/tasks
  • One-click "Open in..." native editor button in toolbar/context menu
  • Code and chat side-by-side in full app

Native Editor Flow

  • Detect installed editors (VS Code, Cursor, Windsurf, Antigravity)
  • Minimize main window, open workspace folder in selected editor
  • Start file watching/sync (fs.watch/chokidar)
  • Floating chat panel appears, stays always-on-top
  • Real-time messaging with agent/task
  • Tray menu to reopen Milady or floating chat

Floating Chat Widget

  • Lightweight always-on-top chat component
  • Connects to orchestrator agent or specific coding agent (per session)
  • Shows task context, history, agent progress, and accepts new prompts/messages
  • Can restore Milady main window from widget/tray or minimize again
  • Optionally shows PTY output for direct agent feedback
  • All UI theming consistent with Milady app

IPC and Sync

  • Electron IPC handles minimizing/restoring windows and floating chat lifecycle
  • WebSockets (or IPC bridge) streams real-time agent/LLM messages
  • File watcher syncs edits between IDE, agent, and native editors

Tray and Hotkey Integration

  • Tray shows status/active tasks, can open main app or floating chat
  • Register/remove global hotkeys for fast window switching

Backend/Frontend Changes Required

  • new apps/ide-app (React/Electrobun) with Monaco/VSCode integration
  • IPC handlers and protocols in apps/app/electrobun to support floating widget, editor launch, window min/max
  • Tray and global hotkey menu additions
  • File watcher bridge (shared or backend package)
  • Floating chat component (packages/app-core/components/floating-chat/)
  • Registry integration/add manifest for IDE app
  • Tests/smoke tests for workflows above

Additional Details

  • Floating chat widget should reconnect to previous context if reopened from system tray.
  • Both agent and user can send files/diffs/previews as messages in chat.
  • Configuration allows disabling floating chat (returns to main app restore on minimize).
  • Support for “Open in [Editor]” is extensible—enumerate detected editors for cross-platform.

Please generate a complete implementation plan in the repo and start the necessary foundational code/scaffold for the Electron, IDE app, bridge, floating chat widget, and registry integration.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: can you please identify everything needed in order to have a plugin/app to work and be available in the apps section of the milady app

Assistant: I'll help you identify everything needed for a plugin/app to work in the milady app. Let me start by exploring the repository structure and understanding how plugins/apps are configured.

Assistant: Now let me search for more specific information about the app structure and requirements:

Assistant: Now I have comprehensive information to provide a detailed answer. Let me search for more specific app-related documentation:

Assistant: Based on my research of the milady-ai/milady repository, here's a comprehensive checklist of everything needed for a plugin/app to work and be available in the apps section of the Milady app:


🎯 Complete Plugin/App Setup Checklist

**1. Core Plugin...

Custom agent used: milady-architect
Use for architectural decisions about the elizaOS runtime, plugin resolution, NODE_PATH setup, Electrobun boundaries, or cross-layer feature design in the Milady codebase. Invoke before large refactors or any change touching runtime/plugin/desktop seams. Pairs with milady-feature-coordinator for execution.

This pull request was created from Copilot chat.

Copilot AI and others added 2 commits April 9, 2026 09:00
…nager + RPC wiring

Agent-Logs-Url: https://github.com/milady-ai/milady/sessions/f52ef7e2-5fef-429d-920e-73ce4dc182cf

Co-authored-by: Dexploarer <211557447+Dexploarer@users.noreply.github.com>
Agent-Logs-Url: https://github.com/milady-ai/milady/sessions/f52ef7e2-5fef-429d-920e-73ce4dc182cf

Co-authored-by: Dexploarer <211557447+Dexploarer@users.noreply.github.com>
Copilot AI changed the title [WIP] Build modern IDE app with native editor bridge feat: native editor bridge, workspace file watcher, and floating chat window for desktop Apr 9, 2026
Copilot AI requested a review from Dexploarer April 9, 2026 10:05
@lalalune lalalune merged commit 31c528a into develop Apr 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants